from config import path_cfg


class OpenAccountApi(object):

    def __init__(self, session):
        self.session = session
        self.real_name_url = path_cfg.P2P_URL + path_cfg.REAL_NAME_URL
        self.open_account_url = path_cfg.P2P_URL + path_cfg.OPEN_ACCOUNT_URL

    # 实名认证接口
    def real_name(self, body):
        return self.session.post(url=self.real_name_url, data=body, files={'x': 'y'})

    # 开户接口
    def open_account(self):
        return self.session.post(url=self.open_account_url)

    # 第三方开户接口
    def third_open_account(self, url, form_dict):
        return self.session.post(url=url, data=form_dict)

